<?php

namespace App\Http\Controllers\Admin;

use App\Http\Query\CategoryQuery;
use app\Model\Base;
use app\Model\OrderModel;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use Log;
use function MongoDB\BSON\toJSON;
use SplFileObject;

class JapanIncomeMoneyController extends Controller

{
    function income_money(Request $request)
    {
        $state = $request->input('state', '1');
        $star_date = $request->input('star_date');
        $end_date = $request->input('end_date');
        $map['state'] = $state;
        if (!empty($star_date) && !empty($end_date)) {
            $list = DB::table('user_order')->where($map)->whereBetween('create_time', [$star_date, $end_date])->get();
        } else {
            $list = DB::table('user_order')->where($map)->get();
        }
        return view('warehouse.income_money', array(
            'orderList' => $list,
            'state' => $state,
            'star_date' => $star_date,
            'end_date' => $end_date,
        )); // 返回视图

    }
}
